import org.codehaus.jackson.map.ObjectMapper

/**
  * @Desc
  * @Author chenchi03
  * @CreateTime 2020-04-22 20:01
  */
object Test4 {
    def main(args: Array[String]): Unit = {
        val dataStr =
            """
              |{
              |    "gr_ext": { },
              |    "client_option": { },
              |    "ubc_id": 10504,
              |    "content": {
              |        "page": "sr_h5_mvpd",
              |        "source": "",
              |        "id": "sv_15276272744981632001",
              |        "type": "1st_frame",
              |        "from": "search",
              |        "value": "video_page"
              |    }
              |}
            """.stripMargin
        val dataNode = new ObjectMapper().readTree(dataStr)
        val ubc_id = dataNode.get("ubc_id").toString
        val vid = dataNode.get("content").get("id").asText()
        println(ubc_id.equals("10504"))
        println(vid)
    }
}
